home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / tip / font-cpp.tip < prev    next >
Text File  |  1993-09-15  |  2KB  |  46 lines

  1. % This macro source file is from the four volume series
  2. % "TeX in Practice" by Stephan von Bechtolsheim, published
  3. % 1993 by Springer-Verlag, New York.
  4. % Copyright 1993 Stephan von Bechtolsheim.
  5. % No warranty or liability is assumed.
  6. % This macro may be copied freely if no fees other than
  7. % media cost or shipping charges are charged and as long
  8. % as this copyright and the following source code itself
  9. % is not changed. Please see the series for further information.
  10. %
  11. % Version: 1.0
  12. % Date: May 1, 1993
  13. %
  14. %
  15. % This source code is documented in 16.2.11, p. II-283.
  16. % Original source in file "fonts2.TEX", starting line 1007.
  17. \wlog{L: "font-cpp.tip" ["fonts2.TEX," l. 1007, p. II-283]}%
  18. % This file DOES belong to format "texip."
  19. \InputD{leadingz.tip}
  20. \InputD{imodn.tip}
  21. \def\CharactersPerPica #1{% 
  22.     \setbox0 = \hbox{%
  23.         #1\relax
  24.         This paragraph has 423 characters. We know that
  25.         because we counted it. It is very simple to count, because
  26.         the Emacs editor we are using has a function ``advance
  27.         by one character.'' And with the prefix command (that's
  28.         Emacs terminology) you can execute ``advance by
  29.         one character'' 423~times. Now, let's hope that this text
  30.         is representative of ordinary text so that our average
  31.         number of characters per pica is correct.
  32.     }%
  33.     {%
  34.         \count1 = \wd0
  35.         \divide\count1 by 100
  36.         \count0 = 423
  37.         \multiply\count0 by 65536
  38.         \multiply\count0 by 12
  39.         \divide\count0 by \count1
  40.         \count2 = \count0
  41.         \divide\count2 by 100
  42.         \IModN{\count0}{100}{\count3}%
  43.         \the\count2.\LeadingZ{\count3}%
  44.     }%
  45. }
  46.